import net.dongliu.requests.Requests;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author yyq
 * @create 2021-09-02 11:28
 */
public class jkdk {
//    uid: 账号
//upw: 密码
//"smbtn","进入健康状况上报平台"
//"hh28","540"
    public static void main(String[] args) {
        Map param=new HashMap();
        param.put("uid","");
        param.put("upw", "");
        param.put("smbtn","进入健康状况上报平台");
        param.put("hh28","540");

        Map header=new HashMap();
        header.put("Content-Type","application/x-www-form-urlencoded");
        header.put("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 HBPC/11.0.6.301");
        header.put("Referer","https://jksb.v.zzu.edu.cn/vls6sss/zzujksb.dll/first0");
        String url="https://jksb.v.zzu.edu.cn/vls6sss/zzujksb.dll/login";
        String s = Requests.post(url).headers(header).forms(param).send().readToText();
       System.out.println("第一次请求"+url);


        Pattern pattern = Pattern.compile("https?://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]");
        Matcher matcher = pattern.matcher(s);

        String url1="";
        if (matcher.find()) {
            System.out.println(matcher.group());
            url1= matcher.group().toString();
        }
        System.out.println("第二次请求"+url1);

        Map header_1=new HashMap();
        header_1.put("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 HBPC/11.0.6.301");
        header_1.put("Referer","https://jksb.v.zzu.edu.cn/vls6sss/zzujksb.dll/login");
        String toText = Requests.get(url1).headers(header_1).send().readToText();

        Map header_2=new HashMap();
        header_2.put("User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 HBPC/11.0.6.301");
        header_2.put("Referer",url1);
        String url2="https://jksb.v.zzu.edu.cn/vls6sss/zzujksb.dll/jksb?ptopid=s1914D623DC494723AA1DFA628DBFAB17&sid=210902192520678678&fun2=";
        String s1 = Requests.get(url2).headers(header).send().readToText();
        System.out.println(s1);


    }
}
